<template>
  <fieldset>
    <legend>商品列表</legend>
    <ul>
      <li v-for="(item, i) in name" :key="i" @click="clickFn(item.productId)">
        {{ item.productName }}
      </li>
    </ul>
  </fieldset>
</template>
<script>
export default {
  data() {
    return {
      name: "",
    };
  },
  methods: {
    clickFn(i) {
      this.$router.push({ name: "particulars", params: { particulars: i } });
    },
  },
  mounted() {
    fetch("http://chst.vip:1234/api/getmoneyctrl")
      .then((body) => body.json())
      .then((res) => {
        this.name = res.result;
      });
  },
};
</script>
<style lang="scss" scoped></style>
